#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdbool.h>

struct date
{
	int day;
	int month;
	int year;
};

bool isLeap(struct date d);
int numberOfdays(struct date d);

int main()
{
	struct date today, tommorow;

	printf("Please enter the date of today:>");
	scanf("%d %d %d", &today.year, &today.month, &today.day);

	if (today.day != numberOfdays(today))
	{
		tommorow.day = today.day + 1;
		tommorow.month = today.month;
		tommorow.year = today.year;
	}
	else if (today.month == 12)
	{
		tommorow.day = 1;
		tommorow.month = 1;
		tommorow.year = today.year + 1;
	}
	else
	{
		tommorow.day = 1;
		tommorow.month = today.month + 1;
		tommorow.year = today.year;
	}

	printf("Tomorow's date is %d %d %d\n",
		tommorow.year, tommorow.month, tommorow.day);
}

int numberOfdays(struct date d)
{
	const int daysThismonth[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };

	int days;

	if (d.month == 2 && isLeap(d))
	{
		days = 29;
	}
	else
	{
		days = daysThismonth[d.month - 1];
	}

	return days;
}

bool isLeap(struct date d)
{
	bool leap = false;
	if ((d.year % 4 == 0 && d.year % 100 != 0) || d.year % 400 == 0)
	{
		leap = true;
	}

	return leap;
}